import request from '@/api/index'
import { ThingType } from '@coolphk/shared-types/low-code'
import { Result } from '@/types/request'
import { mockThings } from '@/api/mockData'

export async function getThings() {
  return window.$wujie.props.ThingApi.getThingPageWithService({
    pageNo: 1,
    pageSize: 100,
  })
}

export async function getThingWithService() {
  return request.ThingApi.getThingPageWithService({
    pageNo: 1,
    pageSize: 100,
  })
  // return request.get<Thing[]>(`${moduleURL}/all-with-service`)
  /*return Promise.resolve<Result<ThingType[]>>(
    {
      code: 200,
      data: mockThings,
      message: '',
    },
  )*/

}

/**
 * 调用服务
 * @param {params} curService
 * @param {Object} data
 */
export function getServiceData(curService, data) {
  /*let url = ''
  if (curService.type === 'things') {
    url = `Thingmax/Things/${curService.thingInfo.thingCode}/Services/${curService.thingInfo.serviceName}`
  }*/
  return Promise.resolve()
  /*return request({
    url,
    method: curService.method,
    data,
  })*/
}





